package cn.hzxs.zjn.service;

import cn.hzxs.zjn.mapper.FoldersAndNotesMapper;
import cn.hzxs.zjn.pojo.Folder;
import cn.hzxs.zjn.pojo.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

/**
 * @Author: Zjn ; Bring it on !!!
 * @Date: 2021/4/23 0023 7:50
 * Note:
 */
@Service("FoldersAndNotesService")
public class FolderSAndNotesServiceImpl implements FoldersAndNotesService {
    @Autowired
    FoldersAndNotesMapper foldersAndNotesMapper;

    @Override
    public String findPassWordByuUserName(String USERNAME) {
        return foldersAndNotesMapper.findPassWordByuUserName(USERNAME);
    }

    @Override
    public Map findInfoByUserName(String USERNAME) {
        return foldersAndNotesMapper.findInfoByUserName(USERNAME);
    }

    @Override
    public List<Map> getNotes(BigInteger ACCOUNTID) {
        return foldersAndNotesMapper.getNotes(ACCOUNTID);
    }

    @Override
    public List<Map> getFolders(BigInteger USERID) {
        return foldersAndNotesMapper.getFolders(USERID);
    }

    @Override
    public List<Map> getFolderNotes(BigInteger folderId, BigInteger userId) {
        return foldersAndNotesMapper.getFolderNotes(folderId,userId);
    }

    @Override
    public int addNote(Note note) {
        return foldersAndNotesMapper.addNote(note);
    }

    @Override
    public int addFolder(Folder folder) {
        return foldersAndNotesMapper.addFolder(folder);
    }

    @Override
    public String noteCount(BigInteger ACCOUNTID) {
        return foldersAndNotesMapper.noteCount(ACCOUNTID);
    }

    @Override
    public BigInteger selectUserId(String username) {
        return foldersAndNotesMapper.selectUserId(username);
    }
}
